#-*- coding:utf-8 -*-
#作用：导航树
#作者：尚墨
#日期：2017年11月24日
#邮箱：ws1992jx@163.com
#

from urllib.request import urlopen
from bs4 import BeautifulSoup

html=urlopen('http://www.pythonscraping.com/pages/page3.html')
bsObj=BeautifulSoup(html)
'''
for child in bsObj.find('table',{"id":"giftList"}).children:
	print (child)

print ("<=================================================>")

print (bsObj.div.findAll("img"))
print ("<=================================================>")
'''
#for div in bsObj.div.findAll("img"):
#	print (div)

#for sibling in bsObj.find("table",{"id":"giftList"}).tr.previous_siblings:
	#print (sibling)

print (bsObj.find("img",{"src":"../img/gifts/img1.jpg"}).parent.previous_sibling)